"""
通知数据模型
"""
from sqlalchemy import Column, Integer, String, Boolean, Text, SmallInteger, DateTime, func
from core.database import Base


class Notification(Base):
    """通知模型"""
    __tablename__ = "notifications"
    __table_args__ = {"comment": "存储系统通知信息"}

    id = Column(Integer, primary_key=True, index=True, comment="通知的唯一标识符")
    title = Column(String(200), nullable=False, comment="通知标题")
    desc = Column(Text, nullable=False, comment="通知描述")
    date = Column(String(50), nullable=False, comment="通知日期")
    is_read = Column(Boolean, default=False, nullable=False, comment="是否已读")
    status = Column(SmallInteger, default=1, nullable=False, comment="状态，1表示正常，0表示已删除")
    created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False, comment="创建时间")
    updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False, comment="更新时间")

